<?php

namespace common\models\ar;

use Yii;

/**
 * This is the model class for table "user".
 *
 * @property int $userID 用户唯一编号
 * @property string $loginName 用户登录系统名
 * @property string $loginpsw 用户登录密码
 * @property string $accountName
 * @property int $userType 账户类型1001普通用户,1011综合设置和监控账户,1021风控人员
 * @property string $address
 * @property string $cellPhone 佣金备注
 * @property string $RegisterDate 注册日期
 * @property string $line_waring 告警线
 * @property string $line_ForceClose 强评线
 * @property string $line_LimitOpen 限制开仓线
 * @property int $limit_openorder 一键限制开仓,0x01为限制0x00为不限制
 * @property int $hedgeStrategy 对冲策略对冲策略(值1,2,3,4,5,6分别对应对冲策略一、二、三、四、五、六)
 * @property int $agentID
 * @property string $alias 别名
 * @property int $templatePtId 该用户对应的模板Id
 * @property int $login_flag 1为已实名2为新注册未实名3未待实名
 * @property string $updatePswTime
 * @property string $lastLoginTime
 * @property int $maxPositionsVolumes
 * @property int $overNightFlag 是否隔夜
 */
class User extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'user';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['loginName', 'loginpsw', 'accountName', 'address', 'RegisterDate'], 'required'],
            [['userType', 'limit_openorder', 'hedgeStrategy', 'agentID', 'templatePtId', 'login_flag', 'maxPositionsVolumes', 'overNightFlag'], 'integer'],
            [['RegisterDate', 'updatePswTime', 'lastLoginTime'], 'safe'],
            [['line_waring', 'line_ForceClose', 'line_LimitOpen'], 'number'],
            [['loginName'], 'string', 'max' => 40],
            [['loginpsw', 'accountName'], 'string', 'max' => 45],
            [['address'], 'string', 'max' => 300],
            [['cellPhone'], 'string', 'max' => 30],
            [['alias'], 'string', 'max' => 50],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'userID' => 'User ID',
            'loginName' => 'Login Name',
            'loginpsw' => 'Loginpsw',
            'accountName' => 'Account Name',
            'userType' => 'User Type',
            'address' => 'Address',
            'cellPhone' => 'Cell Phone',
            'RegisterDate' => 'Register Date',
            'line_waring' => 'Line Waring',
            'line_ForceClose' => 'Line  Force Close',
            'line_LimitOpen' => 'Line  Limit Open',
            'limit_openorder' => 'Limit Openorder',
            'hedgeStrategy' => 'Hedge Strategy',
            'agentID' => 'Agent ID',
            'alias' => 'Alias',
            'templatePtId' => 'Template Pt ID',
            'login_flag' => 'Login Flag',
            'updatePswTime' => 'Update Psw Time',
            'lastLoginTime' => 'Last Login Time',
            'maxPositionsVolumes' => 'Max Positions Volumes',
            'overNightFlag' => 'Over Night Flag',
        ];
    }
}
